package com.yidao.customer.domain;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

import com.yidao.core.domain.BaseDomainObject;
import com.yidao.organization.domain.Company;

@Entity
@Table(name="customers")
public class Customer extends BaseDomainObject{

	public static final String GENDER_FEMALE = "female";
	
	public static final String GENDER_MALE = "male";
	
	public static final String[] genderOptions = new String[]{GENDER_MALE,GENDER_FEMALE};
	
    private static final long serialVersionUID = 1L;
	
    public static String[] getGenderOptions() {
		return genderOptions;
	}
    
    private Date birthday;

	private String bizPhone;
    
    private Company company;
    
    private String email;
	
    @Size(max=10)
	private String gender;
    
    private String homePhone;
    
    @Size(max=100)
	private String jobTitle;
    
    private String msn;

	@NotNull
    @Size(min=1,max=100)
	private String name;

	private String qq;

	@Column
	public Date getBirthday() {
		return birthday;
	}
	
	@Column
	public String getBizPhone() {
		return bizPhone;
	}
	
	@ManyToOne
	@JoinColumn(name="company_id")
	public Company getCompany() {
		return company;
	}
	
	@Column
	public String getEmail() {
		return email;
	}

	@Column
	public String getGender() {
		return gender;
	}
	
	@Column
	public String getHomePhone() {
		return homePhone;
	}

	@Column
	public String getJobTitle() {
		return jobTitle;
	}
	
	@Column
	public String getMsn() {
		return msn;
	}

	@Column
	public String getName() {
		return name;
	}
	
	@Column
	public String getQq() {
		return qq;
	}
    
    public void setBirthday(Date birthday) {
		this.birthday = birthday;
	}
    
    public void setBizPhone(String bizPhone) {
		this.bizPhone = bizPhone;
	}
    
	public void setCompany(Company company) {
		this.company = company;
	}
	
	public void setEmail(String email) {
		this.email = email;
	}
	
	public void setGender(String gender) {
		this.gender = gender;
	}

	public void setHomePhone(String homePhone) {
		this.homePhone = homePhone;
	}

	public void setJobTitle(String jobTitle) {
		this.jobTitle = jobTitle;
	}

	public void setMsn(String msn) {
		this.msn = msn;
	}

	public void setName(String name) {
		this.name = name;
	}

	public void setQq(String qq) {
		this.qq = qq;
	}
}
